<template>
  <view class="router-view bcl-active " style="padding:10px;">

    <view class="" style="background:#fff;">
      
	<!-- <u-input v-model="value" :type="type" :border="border" :auto-height="autoHeight" /> -->
  	<u-input v-model="value" :type="type" :border="border" :height="height" :auto-height="autoHeight" />



           
                    
        <button
          class="uni-button uni-button-lg uni-button-full mt-30"
          @tap="saveInfo"
        >
          保存并更新
        </button>
    </view>
  </view>
</template>

<script>
import {
  userIntro,
  delProject,
  delJob,
  addProject,
  addJob,
  editProject,
  editJob,
  addEduition,
  resumeTrainingsSave,
  resumeLanguagesSave,
  resumeCertificatesSave,
  resumeEncryptSave,
  infoUpdate
} from "@/apis/user";

import uniCell from "@/components/cell";
export default {

  components: {
    uniCell,
  },
  data() {
    return {
      type:'',
      types:'',
      show: false,
      shows: false,
      province:[],
      speciality:[],
      provinces:'',
      specialitys:'',
      number:'',
      name:'',
      value: '',
      type: 'textarea',
      border: true,
      				height: 100,

      autoHeight: true,
      
    };
  },

  onLoad(options) {
    // console.log("options",options)
    this.type =  options.type
    var type = options.type
    var titie;
    if(type == 9){
      titie = '添加自我评价'
    }
    uni.setNavigationBarTitle({
      title: titie
    })
    this.getUserIntro();
  },

  methods: {
    confirm(e) {
        console.log(e);
        this.provinces = e[0].value
    },
    confirms(e) {
        console.log(e);
        this.specialitys = e[0].value
    },
    

    async getUserIntro() {
      let { code, data, message } = await userIntro();
      if (code === 200){
        this.userIntro = data;
        this.province = data.province
        this.speciality = data.encrypt_speciality
        console.log(data)
      } 
      
    },
    async saveInfo(){
      var params = {
          introduce:this.value

      };
      let { code, data } = await infoUpdate(params);
      if (code === 200) {
        // await this.getUserIntro();
        
        this.$toast("操作成功");
        setTimeout(()=>{
         
        uni.navigateBack();
        },1000);
      }
    },
    

    
  },
};
</script>

<style lang="scss" scoped>
.router-view {
  .user-info {
    .uni-avatar {
      width: 100upx;
      height: 100upx;
      image {
        width: 100%;
        height: 100%;
        vertical-align: middle;
      }
    }
  }
  .work {
    .icon-plus {
      width: 40upx;
      height: 40upx;
      text-align: center;
      padding: 5upx;
    }

    .work-content {
      padding-top: 40upx;
      border-bottom: 1upx solid $color-border-deep;
      padding-bottom: 40upx;

      &:first-child {
        padding-top: 0;
      }

      &:last-child {
        padding-bottom: 0;
        border-bottom: 0;
      }

      .time-tag {
        padding: 10upx 20upx;
        border-radius: 100upx;
      }
    }
  }
  .uni-input {
    margin-bottom: 0;
    border: 0;
  }
}
.photoimg{
  width:35px;
  height:35px;
  margin:19px 0 0 0;
}
</style>
